import { h } from 'vue';
import { NTag,NAvatar } from 'naive-ui';

export const columns = [
  {
    title: '头像',
    key: 'avatar',
    width: 60,
    render(row) {
      return h(
        NAvatar,
        {
          src: row.avatar,
          round:true
        },
      );
    },
  },
  {
    title: '用户姓名',
    key: 'name',
  },
  {
    title: '账号',
    key: 'username',
  },
  {
    title: '手机号',
    key: 'mobile',
    width: 130,
  },
  {
    title: '邮箱',
    key: 'email',
  },
  {
    title: '状态',
    key: 'accountNonLocked',
    width: 80,
    render(row) {
      return h(
        NTag,
        {
          type: row.accountNonLocked === true ? 'success' : 'error',
        },
        {
          default: () => (row.accountNonLocked === true ? '正常' : '锁定'),
        }
      );
    },
  },
];

export const positionColumns = [
  {
    title: '职位名称',
    key: 'positionName',
  },
  {
    title: '职位级别',
    key: 'level',
  },
  {
    title: '职位代码',
    key: 'positionCode',
  },
];
